Distributed systems can be made up of various components, including both hardware and software. A distributed system (1) allows its users to share services and resources over a network of many devices; (2) provides programmers with tools and programming patterns that allow development of robust, secured distributed systems; and (3) simplifies the task of administering the distributed system.
A distributed system can be implemented using an object-oriented programming language, such as Java™. The Java™ programming language is typically compiled into a platform-independent format, using a bytecode instruction set, which can be executed on any platform supporting the Java™ virtual machine. The Java™ programming language is described in greater detail in The Java™ Language Specification by James Gosling, Bill Joy, and Guy Steele, Addison-Wesley, 1996, which is incorporated herein by reference. Java™ and Jave-based trademarks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
Distributed systems require that programs running in different address spaces be able to communicate with each other. In a system using an object-oriented programming language, such as the Java™ programming language, this communication can be achieved by passing an “object,” which represents an item or instance manipulated by the system, from one program to another. In such a system, a “class” provides a template for the creation of objects having characteristics of that class. The objects in each class share certain characteristics or attributes determined by the class. A class thus defines the type of an object. Objects are typically created dynamically during system operation. Methods associated with a class are generally invoked on the objects of the same class or subclass.
In a Java™ distributed system, an object is referred to as being remote when its methods can be invoked from another address space, typically a Java™ virtual machine on a different computer. A remote object is described by one or more remote interfaces, which are Java™ interfaces that declare the methods of the remote object. Remote Method Invocation (RMI) is used to invoke a method of a remote interface on a remote object. RMI is explained in, for example, the Remote Method Invocation Specification, Sun Microsystems, Inc. (1997), which is incorporated herein by reference.
As part of RMI, Java™ objects are passed between a client and a server. Before being passed, a Java™ object is converted into a serialized representation of itself. The serialized representation of the object contains enough information to enable the recipient to identify and verify the Java™ class from which the contents of the object were saved and to restore the contents to a new instance. A serialized object contains two main parts: the object data and a class descriptor. The class descriptor describes the content and format of the object data.
When a serialized object is passed, the object data and the class descriptor are transmitted across the network. Although the object data may change over time, the class descriptor remains the same. Therefore, multiple remote method calls can result in passing the same class descriptor multiple times to a recipient who already has a copy of the class descriptor. This is expensive in terms of processing time as well as wasted network bandwidth. It is therefore desirable to reduce the number of times that a class descriptor is sent to a recipient.